package com.example.toutiao.db;

public class Product {
    private int id; // 商品ID
    private String name; // 商品名称
    private double price; // 商品价格
    private String description; // 商品描述
    private String image; // 商品图片路径
    private int imageResId; // 商品图片资源ID

    // 构造函数
    public Product(int id, String name, double price, String description, String image) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.description = description;
        this.image = image;
    }

    public Product(String name, double price, String description, String image) {
        this.id = 0; // 假设 id 为 0，由数据库自动生成
        this.name = name;
        this.price = price;
        this.description = description;
        this.image = image;
    }

    // Getter 方法
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }

    public double getPrice() {
        return price;
    }

    public String getDescription() {
        return description;
    }

    public String getImage() {
        return image;
    }

    public int getImageResId() {
        return imageResId;
    }
}
